﻿using System.Linq;
using System.Web.Mvc;

namespace ComeSeeThis_MVC2.Models
{
    public class TireFormView
    {
        #region Properties

        public Tire Tire { get; private set; }
        public SelectList Companies { get; private set; }
        public int TireId { get; private set; }
        //public IEnumerable<VehicleType> VehicleTypes { get; private set; }
        public IQueryable<VehicleType> VehicleTypes { get; private set; }

        #endregion

        public TireFormView(Tire tire)
        {
            Tire = tire;
            TireId = tire.TireId;

            VehicleTypes = new VehicleTypeRepository().GetAllVehicleTypes();
            Companies = new SelectList(new CompanyRepository().GetAllCompanies(0, ProductType.Tire, false), "CompanyId", "CompanyName", tire.CompanyId);
        }
    }
}